package pl.streamsoft.test.model;

import java.util.Date;
import java.util.List;

import pl.streamsoft.test.model.entities.CurrencyAverageEntity;
import pl.streamsoft.test.model.entities.CurrencyEntity;
import pl.streamsoft.test.model.entities.CurrencyTypeEntity;
import pl.streamsoft.test.model.entities.DateEntryEntity;
import pl.streamsoft.test.model.exceptions.DAOException;

public interface CurrenciesDAO {

	// Transaction methods
	public void beginTransaction() throws DAOException;

	public void commitTransaction() throws DAOException;

	public void rollbackTransaction() throws DAOException;

	// CurrencyEntity handling
	public CurrencyEntity insert(CurrencyEntity entity) throws DAOException;

	public CurrencyEntity update(CurrencyEntity entity) throws DAOException;

	public CurrencyEntity delete(CurrencyEntity entity) throws DAOException;

	public CurrencyEntity findCurrency(Integer id) throws DAOException;

	public List<CurrencyEntity> findAllCurrencies(CurrencyTypeEntity typeEntity)
			throws DAOException;

	public List<CurrencyEntity> findAllCurrencies(
			CurrencyTypeEntity typeEntity, int limit, int offset)
			throws DAOException;

	public List<CurrencyEntity> findCurrenciesByDate(Date from, Date to)
			throws DAOException;

	public List<CurrencyEntity> findCurrenciesByDateAndType(Date from, Date to,
			CurrencyTypeEntity typeEntity) throws DAOException;

	// CurrencyTypeEntity handling
	public CurrencyTypeEntity insert(CurrencyTypeEntity entity)
			throws DAOException;

	public CurrencyTypeEntity update(CurrencyTypeEntity entity)
			throws DAOException;

	public CurrencyTypeEntity delete(CurrencyTypeEntity entity)
			throws DAOException;

	public CurrencyTypeEntity findCurrencyType(int id) throws DAOException;

	public CurrencyTypeEntity findCurrencyType(String acronym)
			throws DAOException;

	public List<CurrencyTypeEntity> findAllCurrencyTypes() throws DAOException;

	// DateEntry handling
	public DateEntryEntity insert(DateEntryEntity entity) throws DAOException;

	public DateEntryEntity update(DateEntryEntity entity) throws DAOException;

	public DateEntryEntity delete(DateEntryEntity entity) throws DAOException;

	public DateEntryEntity findDateEntry(int id) throws DAOException;

	public DateEntryEntity findDateEntry(Date date) throws DAOException;

	public List<DateEntryEntity> findAllDateEntries() throws DAOException;

	// CurrencyAverageEntity handling
	public CurrencyAverageEntity insert(CurrencyAverageEntity entity)
			throws DAOException;

	public CurrencyAverageEntity update(CurrencyAverageEntity entity)
			throws DAOException;

	public CurrencyAverageEntity delete(CurrencyAverageEntity entity)
			throws DAOException;

	public CurrencyAverageEntity findCurrencyAverage(int id)
			throws DAOException;

	public CurrencyAverageEntity findCurrencyAverage(
			CurrencyTypeEntity currencyTypeEntity) throws DAOException;

}
